package com.yan.messagesystem.controller;

import com.yan.messagesystem.severice.SevericeImpl;

import java.util.Scanner;

/**
 * @author taoge
 * @Date 2024/7/31 16:52
 * @Description
 */
public class MessageIndex {
    public static final Scanner INPUT = new Scanner(System.in);
    public static final SevericeImpl severiceimpl = new SevericeImpl();
    public static void main(String[] args) {
        while (true) {
            System.out.println("-------------欢迎登录留言板系统-------------------");
            System.out.println("-----------------主菜单------");
            System.out.println("  1.查询留言");
            System.out.println("  2.添加留言");
            System.out.println("  3.退出系统");
            System.out.println("请选择");
            int i = INPUT.nextInt();
            switch (i){
                case 1:
                    severiceimpl.queryMessage();
                    break;
                case 2:
                    severiceimpl.addAMessage();
                    break;
                case 3:
                    System.exit(0);
                    break;
            }
        }
    }
}
